<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<header th:replace="admin/header::header-fragment"></header>
<body class="hold-transition sidebar-mini">
<style>
  .ui-jqgrid tr.jqgrow td {
    white-space: normal !important;
    height: auto;
    vertical-align: text-top;
    padding-top: 2px;
  }
</style>
<div class="wrapper">
  <div th:replace="admin/header::header-nav"></div>
  <div th:replace="admin/sidebar::sidebar-fragment(${path})"></div>
  <div class="content-wrapper">
    <div class="content-header">
      <div class="container-fluid">
      </div>
    </div>
    <div class="content">
      <div class="container-fluid">
        <div class="card card-primary card-outline">
          <div class="card-header">
            <h3 class="card-title">友链管理</h3>
          </div>
          <div class="card-body">
            <div class="grid-btn">
              <button class="btn btn-info" onclick="linkAdd()"><i
                      class="fa fa-plus"></i>&nbsp;增加
              </button>
              <button class="btn btn-info" onclick="linkEdit()"><i
                      class="fa fa-pencil-square-o"></i>&nbsp;修改
              </button>
              <button class="btn btn-danger" onclick="deleteLink()"><i
                      class="fa fa-trash-o"></i>&nbsp;删除
              </button>
            </div>
            <table id="jqGrid" class="table table-bordered">
            </table>
            <div id="jqGridPager"></div>
          </div>
        </div>
      </div>
    </div>
    <div class="content">
      <!-- 模态框 -->
      <div class="modal fade" id="linkModal" tabindex="-1" role="dialog" aria-labelledby="linkModalLabel">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                      aria-hidden="true">&times;</span></button>
              <h6 class="modal-title" id="linkModalLabel">Modal</h6>
            </div>
            <div class="modal-body">
              <form id="linkForm">
                <div class="form-group">
                  <div class="alert alert-danger" id="edit-error-msg" style="display: none;">
                    错误信息展示栏。
                  </div>
                </div>
                <input type="hidden" class="form-control" id="linkId" name="linkId">
                <div class="form-group">
                  <label for="linkType" class="control-label">友链类型:</label>
                  <select class="form-control" id="linkType" name="linkType">
                    <option selected="selected" value="0">友链</option>
                    <option value="1">推荐网站</option>
                    <option value="2">个人链接</option>
                  </select>
                </div>
                <div class="form-group">
                  <label for="linkName" class="control-label">网站名称:</label>
                  <input type="text" class="form-control" id="linkName" name="linkName"
                         placeholder="请输入网站名称" required="true">
                </div>
                <div class="form-group">
                  <label for="linkUrl" class="control-label">网站链接:</label>
                  <input type="url" class="form-control" id="linkUrl" name="linkUrl"
                         placeholder="请输入网站链接" required="true">
                </div>
                <div class="form-group">
                  <label for="linkDescription" class="control-label">网站描述:</label>
                  <input type="url" class="form-control" id="linkDescription" name="linkDescription"
                         placeholder="请输入网站描述" required="true">
                </div>
                <div class="form-group">
                  <label for="linkRank" class="control-label">排序值:</label>
                  <input type="number" class="form-control" id="linkRank" name="linkRank"
                         placeholder="请输入排序值" required="true">
                </div>
              </form>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
              <button type="button" class="btn btn-primary" id="saveButton">确认</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script th:src="@{/admin/plugins/jquery/jquery.min.js}"></script>
<script th:src="@{/admin/plugins/jQueryUI/jquery-ui.min.js}"></script>
<script th:src="@{/admin/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/admin/dist/js/adminlte.min.js}"></script>
<script th:src="@{/admin/plugins/jqgrid-5.5.2/jquery.jqGrid.min.js}"></script>
<script th:src="@{/admin/plugins/jqgrid-5.5.2/grid.locale-cn.js}"></script>
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<script th:src="@{/admin/dist/js/public.js}"></script>
<script th:src="@{/admin/dist/js/link.js}"></script>
</body>
</html>
